package com.allinpay.merchantweb.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.allinpay.merchantweb.common.utils.SequenceUtil;
import com.allinpay.merchantweb.model.EnterpriseInfo;
import com.allinpay.merchantweb.request.CommonReqBean;
import com.allinpay.merchantweb.response.AppCommonResponse;
import com.allinpay.merchantweb.response.ResponseData;
import com.allinpay.merchantweb.service.IEnterpriseInfoService;
import com.google.gson.reflect.TypeToken;

@Service
public class EnterpriseInfoServiceImpl implements IEnterpriseInfoService{

	@Autowired
	RestRequestService restRequestService;
	
	@Override
	public ResponseData<EnterpriseInfo> queryEnterpriseInfo(EnterpriseInfo enterpriseInfo) throws Exception {
		// TODO Auto-generated method stub
		CommonReqBean reqBean = new CommonReqBean(); 
		reqBean.setReqSsn(SequenceUtil.getAppReqSsn());
		reqBean.setBizContent(enterpriseInfo);
		
		AppCommonResponse<ResponseData<EnterpriseInfo>> respBean = restRequestService.postToAppForSingleByObj
				("/enterpriseInfo/getEnterpriseInfo", reqBean
						,new TypeToken<AppCommonResponse<ResponseData<EnterpriseInfo>>>() {}.getType()
				);
		if( respBean != null) {
			return respBean.getData();
		}
		return null;
	}

}
